import matplotlib.pyplot as plt
import pandas as pd

plt.rcParams['font.sans-serif'] = ['KaiTi'] # 指定默认字体
plt.rcParams['axes.unicode_minus'] = False

data = pd.read_csv(filepath_or_buffer='data.csv', usecols=['candle_begin_time','equity_curve','equity_curve_reverse'])
time = data['candle_begin_time'].values.tolist()
value = data['equity_curve'].values.tolist()
value_reverse = data['equity_curve_reverse'].values.tolist()
plt.figure(figsize=(16, 9))
plt.title('资金净值折线图')
plt.plot(time, value, color='red', label='正向操作')
plt.plot(time, value_reverse, color='blue', label='反向操作')
plt.xticks(rotation=90)
plt.legend()
# plt.show()
plt.savefig('资金净值折线图.jpg')